#!/bin/bash
count=50
rid=0
host=192.168.1.111
interval=200

if [ -d log ]; then
    rm log/*
    echo "clear log dir"
else
    mkdir log
    echo "create log dir"
fi

echo "start from $1"

for i in $(seq $count);
do
    rid=$(($1+$i))
    java -jar robot.jar $rid $interval $host > "log/rlog$rid" &
    echo "start robot $rid"
    sleep 0.5s
done